package com.training.thread.section01;

//一般用实现Runnable接口，因为Java是单继承
public class MyThread02 implements Runnable {

	@Override
	public void run() {
		for(int i = 0 ; i < 10 ; i++) {
			System.out.println(Thread.currentThread().getName()+":"+i);
			try {
				Thread.sleep(200);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

	}
	public static void main(String[] args) {
		Thread t1 = new Thread(new MyThread02());
		Thread t2 = new Thread(new MyThread02());
		
		t1.start();
		t2.start();
	}

}
